<?php
/*##################################################
# 模块功能：保存功能配置
###################################################*/
 require_once('class.db.php');
 session_start(); 
 if(isset($_SESSION['lock_config'])){ $time=(int)$_SESSION['lock_config']-(int)time(); if($time>0){ exit(json_encode(array('success'=>0,'icon'=>5,'msg'=>"请勿频繁提交，".$time."秒后再试！")));}}
 $_SESSION['lock_config']= time()+ $from_timeout;

 $lywq['Wechat']['status'] = filter_input(INPUT_POST, "lywq_Wechat_status");
 $lywq['Wechat']['duijie'] = filter_input(INPUT_POST, "lywq_Wechat_duijie");
 $lywq['Wechat']['sousuo'] = filter_input(INPUT_POST, "lywq_Wechat_sousuo");
 $lywq['Wechat']['token'] = filter_input(INPUT_POST, "lywq_Wechat_token");
 $lywq['Wechat']['guanzhu'] = filter_input(INPUT_POST, "lywq_Wechat_guanzhu");
 $lywq['Wechat']['wuziyuan'] = filter_input(INPUT_POST, "lywq_Wechat_wuziyuan");
 $lywq['Wechat']['wuziyuanlink'] = filter_input(INPUT_POST, "lywq_Wechat_wuziyuanlink");
 $lywq['Wechat']['bofang'] = filter_input(INPUT_POST, "lywq_Wechat_bofang");
 $lywq['Wechat']['msgtype'] = filter_input(INPUT_POST, "lywq_Wechat_msgtype");
 $lywq['Wechat']['qrcode'] = filter_input(INPUT_POST, "lywq_Wechat_qrcode");
 $lywq['Wechat']['antiRedStatus'] = filter_input(INPUT_POST, "lywq_Wechat_antiRedStatus");
 $lywq['Wechat']['antiRedSupply'] = filter_input(INPUT_POST, "lywq_Wechat_antiRedSupply");
 $lywq['Wechat']['antiRedType'] = filter_input(INPUT_POST, "lywq_Wechat_antiRedType");
 $lywq['Wechat']['antiRedToken'] = filter_input(INPUT_POST, "lywq_Wechat_antiRedToken");
 $lywq['Wechat']['antiRedApi'] = filter_input(INPUT_POST, "lywq_Wechat_antiRedApi");
 $lywq['Wechat']['antiRedKey'] = filter_input(INPUT_POST, "lywq_Wechat_antiRedKey");
 
 $lywq['Wechat']['passwordstatus'] = filter_input(INPUT_POST, "lywq_Wechat_passwordstatus");
 $lywq['Wechat']['terminal'] = implode("|", $_POST['lywq_Wechat_terminal']);
 $lywq['Wechat']['passwordkey'] = filter_input(INPUT_POST, "lywq_Wechat_passwordkey");
 $lywq['Wechat']['passwordtext'] = filter_input(INPUT_POST, "lywq_Wechat_passwordtext");
 $lywq['Wechat']['RndPassword'] = filter_input(INPUT_POST, "lywq_Wechat_RndPassword");
 $lywq['Wechat']['RndPasswordH'] = filter_input(INPUT_POST, "lywq_Wechat_RndPasswordH");
 $lywq['Wechat']['passworddesc'] = filter_input(INPUT_POST, "lywq_Wechat_passworddesc");
 $lywq['Wechat']['passwordimage'] = filter_input(INPUT_POST, "lywq_Wechat_passwordimage");
 $lywq['Wechat']['passwordurl'] = filter_input(INPUT_POST, "lywq_Wechat_passwordurl");
 $lywq['Wechat']['gzhimage'] = filter_input(INPUT_POST, "lywq_Wechat_gzhimage");
 
 $lywq['Wechat']['gjc1'] = filter_input(INPUT_POST, "lywq_Wechat_gjc1");
 $lywq['Wechat']['gjcm1'] = filter_input(INPUT_POST, "lywq_Wechat_gjcm1");
 $lywq['Wechat']['gjci1'] = filter_input(INPUT_POST, "lywq_Wechat_gjci1");
 $lywq['Wechat']['gjcl1'] = filter_input(INPUT_POST, "lywq_Wechat_gjcl1");
 
 $lywq['Wechat']['gjc2'] = filter_input(INPUT_POST, "lywq_Wechat_gjc2");
 $lywq['Wechat']['gjcm2'] = filter_input(INPUT_POST, "lywq_Wechat_gjcm2");
 $lywq['Wechat']['gjci2'] = filter_input(INPUT_POST, "lywq_Wechat_gjci2");
 $lywq['Wechat']['gjcl2'] = filter_input(INPUT_POST, "lywq_Wechat_gjcl2");
 
 $lywq['Wechat']['gjc3'] = filter_input(INPUT_POST, "lywq_Wechat_gjc3");
 $lywq['Wechat']['gjcm3'] = filter_input(INPUT_POST, "lywq_Wechat_gjcm3");
 $lywq['Wechat']['gjci3'] = filter_input(INPUT_POST, "lywq_Wechat_gjci3");
 $lywq['Wechat']['gjcl3'] = filter_input(INPUT_POST, "lywq_Wechat_gjcl3");
 
 $lywq['Wechat']['gjc4'] = filter_input(INPUT_POST, "lywq_Wechat_gjc4");
 $lywq['Wechat']['gjcm4'] = filter_input(INPUT_POST, "lywq_Wechat_gjcm4");
 $lywq['Wechat']['gjci4'] = filter_input(INPUT_POST, "lywq_Wechat_gjci4");
 $lywq['Wechat']['gjcl4'] = filter_input(INPUT_POST, "lywq_Wechat_gjcl4");
 
 $lywq['Wechat']['gjc5'] = filter_input(INPUT_POST, "lywq_Wechat_gjc5");
 $lywq['Wechat']['gjcm5'] = filter_input(INPUT_POST, "lywq_Wechat_gjcm5");
 $lywq['Wechat']['gjci5'] = filter_input(INPUT_POST, "lywq_Wechat_gjci5");
 $lywq['Wechat']['gjcl5'] = filter_input(INPUT_POST, "lywq_Wechat_gjcl5");
 
 $lywq['Wechat']['gjc6'] = filter_input(INPUT_POST, "lywq_Wechat_gjc6");
 $lywq['Wechat']['gjcm6'] = filter_input(INPUT_POST, "lywq_Wechat_gjcm6");
 $lywq['Wechat']['gjci6'] = filter_input(INPUT_POST, "lywq_Wechat_gjci6");
 $lywq['Wechat']['gjcl6'] = filter_input(INPUT_POST, "lywq_Wechat_gjcl6");
 

if( Main_db::save()){
	exit(json_encode(array('success'=>1,'icon'=>1,'msg'=>"保存成功!")));
}else{
	exit(json_encode(array('success'=>0,'icon'=>0,'msg'=>"保存失败!请检测配置文件权限")));
} 

?>